/********************************************************************************
TITLE:                      	Formatted Output
FILENAME:                   	T_List.h
PREPARED FOR:               	CS215 Section CS13-02
PROGRAMMER(S):              	Eric (Fox) Crowell, (Timothy Drye)
DEVELOPMENT DATE:           	< 12/15/13 >
COMPILER USED:      			Microsoft Visual Studio Professional 2013
- Version 12.0.21005.1 REL
TARGET PLATFORM:         	    Windows 8 x64
================================================================================
REVISION HISTORY

DATE         PROGRAMMER          DESCRIPTION OF CHANGES MADE
------------------------------------------------------------------------------
<12/15/13       Tim                 Class Created.                           >
<12/16/13       Fox                 Removed unneccessary code                >
*******************************************************************************/

#ifndef T_LIST_H
#define T_LIST_H

#include <assert.h>

template<typename T>
class T_List  {

public:
	T_List(); // Default Constructor [Fox]
	T_List(int initSize); // Overloaded Constructor [Fox]
	~T_List(){ delete[] pList; } // Destructor [Fox]

	// Inserts a new item into our pList. [Fox]
	void Insert(const T & item);

	// Must find the first instance of value item in our pList, then remove it (TRUE = successful, FALSE = failed). [Fox]
	bool Remove(const T & item);

	// Find the number of items found in our pList. Returns number of items found. [Fox]
	int NumInList(const T & item) const;

	// Determine if the pList is empty. (TRUE = empty, FALSE = not empty). [Fox]
	bool IsEmpty() const;

	// Display all items in the pList. Returns "T" to have an insertion operator. [Fox]
	void Display() const;

private:
	// To be called when the the Insert member function detects the list is full (Occupancy > Capacity). [Fox]
	// Will double the pList Capacity. (*2) [Fox]
	void Expand();

	// Call the shrink when the capacity is less than half full. [Fox]
	// Will half the pList Capacity. (1/2) [Fox]
	void Shrink();

	T *pList; // The container for our items. [Fox]
	int Capacity; // How many items can our pList hold? [Fox]
	int Occupancy; // How many items are currently in the pList? [Fox]

};

#endif